module.exports = async (ctx, next) => {
  // 设置contentType的类型
  const contentType = 'application/json; charset=utf-8'
  // 将其设置在响应头中
  ctx.set('Content-Type', contentType)
  // 设置响应体
  // ctx.response.body = '{"success": true}'
  ctx.set('Access-Control-Allow-Origin', '*')
  ctx.set('Access-Control-Allow-Methods', '*')
  await next()
}